<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h3 style="text-align: center">未登录，请先<a href="javascript:;" onclick="clickFun()">登录</a></h3>
<p style="text-align: center"><span class="s"></span>秒后自动跳转</p>
</body>
<script>
    function clickFun() {
        top.location.replace("/")
    }
    let s = 5;
    document.querySelector(".s").innerText=s;
    setInterval(function () {
        s--;
        if(s === 0){
            top.location.replace("/")
        }
        document.querySelector(".s").innerText=s;
    },1000)
</script>

</html>
